﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TypeSelectorWindow.aspx.cs" 
    Inherits="Medianamik.UI.Web.ModalWindows.ContentManagement.TypeSelectorWindow" 
    MasterPageFile="~/Medianamik/MasterPages/MedianamikModalWindow.Master" 
    EnableViewState="false" %>

<asp:Content ID="HeaderContentHolder" runat="server" ContentPlaceHolderID="HeaderContentHolder">
	<script type="text/javascript">
        //<![CDATA[
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function Cancel_Clicked()
        {
            var oWindow = GetRadWindow();
            oWindow.argument = null;
            oWindow.Close();
        }
        
        function Select_Clicked() {            
            var arg = new Object();
             <%= (ParentNodeId.HasValue && ParentNodeId.Value != Guid.Empty) ? "arg.ParentNodeId = '" + ParentNodeId.Value + "';" : ""  %>
            arg.NodeTypeId = document.getElementById("<%= ddlNodeTypes.ClientID %>").value;
            var oWindow = GetRadWindow();
            oWindow.Close(arg);            
        }
        //]]>            
	</script>
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
	<fieldset>
	    <asp:PlaceHolder ID="phrMain" runat="server">
		    <p><label><%= Resources("Medianamik_ModalWindows", "TypeSelector_LabelType")%> :</label><asp:DropDownList ID="ddlNodeTypes" runat="server" CssClass="SelectList" style="width:300px;" DataTextField="LocalizedName" DataValueField="ID" /></p>
		    <p><input type="button" class="Btn" value="<%= Resources("Medianamik_ModalWindows", "TypeSelector_BtnCreateElement")%>" onclick="Select_Clicked();" />&nbsp;&nbsp;<input type="button" class="Btn" value="<%= Resources("Medianamik_Global", "Cancel") %>" onclick="Cancel_Clicked();" /></p>
	    </asp:PlaceHolder>
	    <asp:PlaceHolder ID="phrError" Visible="false" runat="server">
	        <p><label><%= Resources("Medianamik_ModalWindows", "TypeSelector_LabelError")%> :</label><asp:Literal ID="litError" runat="server" /></p>
		    <p><input type="button" class="Btn" value="<%= Resources("Medianamik_Global", "Cancel") %>" onclick="Cancel_Clicked();" /></p>
	    </asp:PlaceHolder>
	</fieldset>
</asp:Content>